﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Animation;
using MapLibrary.Players;

namespace MapLibrary.Enemies
{
    class Collectable : Sprite
    {
        public virtual void Collected()
        {

        }

       

        public override bool MyOnCollision(FarseerPhysics.Dynamics.Fixture f1, FarseerPhysics.Dynamics.Fixture f2, FarseerPhysics.Dynamics.Contacts.Contact contact)
        {
            Player p = f2.Body.UserData as Player;

            if (p != null)
            {
                Collected();
                this.World.CurrentLevel.AddBodyToRemove(this);
                return false;
            }

            LevelCollisionRegion lcr = f2.Body.UserData as LevelCollisionRegion;
            if (lcr != null)
            {
                return true;
            }

            return false;
        }
    }
}
